#
# Created: 2025-08-06

import pandas as pd
import matplotlib.pyplot as plt
# 设置全局字体
plt.rcParams['font.family'] = 'Times New Roman'  # 默认使用Times New Roman
# 读取数据
df = pd.read_csv('polar_data.csv')
r = df['r'].values
theta = df['theta'].values
area = df['area'].values
colors = df['color'].values

# 创建图形并绘制极坐标散点图
fig = plt.figure()
ax = fig.add_subplot(projection='polar')
sc = ax.scatter(theta, r, c=colors, s=area, cmap='hsv', alpha=0.75)

# 设置极坐标角度范围，仅显示 45 到 135 度之间
ax.set_thetamin(45)
ax.set_thetamax(135)

# 显示图像
plt.savefig('极坐标图.png', dpi=300, bbox_inches='tight')
plt.show()
